package jdbc;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;

import com.swf.common.utils.FwsFileUtils;
import com.swf.common.utils.FwsPatternUtils;

public class Change {
	public static void main(String[] args) throws FileNotFoundException {
		System.out.println(change());
	}
	
	public static String change(){
		File file = FwsFileUtils.getFile("jdbc/P.txt");
		String content;
		try {
			content = FwsFileUtils.loadFile(file, "GBK");
			List<String> list = FwsPatternUtils.matchedList(content, "\\S+");
		StringBuffer sb = new StringBuffer();
		sb.append(" WHERE T.VC_PARTNERFIELD in (");
		for (int i=0;i<list.size();i++){
			if (i<list.size()-1){
				sb.append("'"+list.get(i)+"',");
			}else{
				sb.append("'"+list.get(i)+"')");
			}
		}
		return  sb.toString();
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "";
	}
}
